/*
 * @Author: DK
 * @Date: 2024-05-04 09:30:31
 * @Last Modified by: mikey.zhaopeng
 * @Last Modified time: 2025-05-05 12:29:47
 */

import Base from "./base";
const api = new Base();

export const login = (data: any) => api.post("/auth/login", data);
export const logout = () => api.post("/auth/logout");

// 查看我的详情
export const getMyDetail = () => api.get("/user");
// 创建用户
export const addUser = (data: any) => api.post("/user", data);
// 修改我的信息
export const updateUser = (data: any) => api.patch("/user", data);
// 注销
export const revokedUser = () => api.delete("/user");
// 修改我的密码
export const changePwd = (data: any) => api.post("/user/editPassword", data);
// 查看用户详情
export const getUserDetail = (userId: string) => api.get(`/user/${userId}`);
// 分页查询用户
export const getUserList = (data:any) => api.get(`/user/page`, data);

// 审核用户信息
export const auditUser = (id: string) => api.post(`/user/audit/${id}/1`)

// 查询收入记录
export const getAllIncome = (data: any) => api.get('/priceRecord/getPriceRecord', data)
export const getIncomeInfo = () => api.get('/totalPrice/getTotalPrice')